<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<c:set var="now" value="<%=java.time.LocalDate.now()%>" />
<c:set var="year" value="${now.year}" />
<c:set var="month" value="${now.monthValue}" />
<c:set var="date" value="${now.dayOfMonth}" />

<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
				<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="/">考勤系统</a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse" id="navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="link"
						href='<spring:url value="/sign.do" />'><span class="glyphicon glyphicon-briefcase"></span>上下班</span>&nbsp;<span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href='<spring:url value="/duty/list.do?y=${year}&m=${month}&d=${date}#${uid}" />'><span
								class="glyphicon glyphicon-time"></span>今日考勤</a></li>
						<li><a href='<spring:url value="/duty/list.do?y=${year}&m=${month}" />'><span class="glyphicon glyphicon-calendar"></span>当月考勤</a></li>
						<li role="separator" class="divider"></li>
						<li><a href='<spring:url value="/sign/list.do?y=${year}&m=${month}&d=${date}" />'><span class="glyphicon glyphicon-time"></span>今日打卡</a></li>
						<li><a href='<spring:url value="/sign/list.do?y=${year}&m=${month}" />'><span class="glyphicon glyphicon-calendar"></span>当月打卡</a></li>
						<li role="separator" class="divider"></li>
						<li><a href='<spring:url value="/duty/worktime/list.do?y=${year}&m=${month}" />'><span
								class="glyphicon glyphicon-sort-by-attributes-alt"></span>上班排行</a></li>
						<li><a href='<spring:url value="/duty/overtime/list.do?y=${year}&m=${month}" />'><span
								class="glyphicon glyphicon-sort-by-attributes-alt"></span>熬夜排行</a></li>
					</ul></li>
				<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="link"
						href='<spring:url value="/leave/apply.do" />'><span class="glyphicon glyphicon-transfer"></span>请假/加班</span>&nbsp;<span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&d=${date}&c=1" />'><span class="glyphicon glyphicon-time"></span>今日请假</a></li>
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&c=1" />'><span class="glyphicon glyphicon-calendar"></span>当月请假</a></li>
						<li role="separator" class="divider"></li>
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&d=${date}&c=2" />'><span class="glyphicon glyphicon-time"></span>今日外出</a></li>
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&c=2" />'><span class="glyphicon glyphicon-calendar"></span>当月外出</a></li>
						<li role="separator" class="divider"></li>
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&d=${date}&c=4" />'><span class="glyphicon glyphicon-time"></span>今日加班</a></li>
						<li><a href='<spring:url value="/leave/list.do?y=${year}&m=${month}&c=4" />'><span class="glyphicon glyphicon-calendar"></span>当月加班</a></li>
						<li role="separator" class="divider"></li>
						<li><a href='<spring:url value="/leave/totaltime/list.do?c=4&st=2" />'><span class="glyphicon glyphicon-time"></span>加班排行</a></li>
						<li><a href='<spring:url value="/leave/totaltime/list.do?c=1&st=2" />'><span class="glyphicon glyphicon-calendar"></span>请假排行</a></li>
						<li><a href='<spring:url value="/leave/leftholiday/list.do?st=2" />'><span class="glyphicon glyphicon-time"></span>可调休假</a></li>
					</ul></li>
				<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="link"
						href='<spring:url value="/abnormalsign/apply.do" />'><span class="glyphicon glyphicon-pushpin"></span>忘打卡</span>&nbsp;<span
						class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href='<spring:url value="/abnormalsign/list.do?y=${year}&m=${month}&d=${date}" />'><span
								class="glyphicon glyphicon-time"></span>今日申请</a></li>
						<li><a href='<spring:url value="/abnormalsign/list.do?y=${year}&m=${month}" />'><span class="glyphicon glyphicon-calendar"></span>当月申请</a></li>
					</ul></li>
				<li><a href='<spring:url value="/staff/list.do" />'><span class="glyphicon glyphicon-user"></span>员工信息</a></li>
				<li><a href='<spring:url value="/help.do" />'><span class="glyphicon glyphicon-user"></span>帮助</a></li>
			</ul>
			<c:if test="${pageType=='list'}">
				<form:form cssClass="navbar-form navbar-left" role="search" modelAttribute="query" method="post">
					<div class="form-group input-group">
						<input id="u" value="${query.u}" class="form-control" placeholder="工号：00001" style="max-width:8.5em;" />
						<span class="input-group-btn">
							<button id="searchByUid" type="button" class="btn btn-default">搜员工</button>
						</span>
					</div>
					<form:hidden path="p" id="p" />
					<form:hidden path="s" id="s" />
				</form:form>
			</c:if>

			<ul class="nav navbar-nav navbar-right">
				<c:choose>
					<c:when test="${userName!=null&&userName!=''}">
						<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
							aria-expanded="false">${userName}<span class="caret"></span></a>
							<ul class="dropdown-menu">
								<li><a href='<spring:url value="/user/editPwd.do"/>'>修改密码</a></li>
								<li role="separator" class="divider"></li>
								<li><a href='<spring:url value="/user/logout.do"/>'>注销</a></li>
							</ul></li>
					</c:when>
				</c:choose>
			</ul>
		</div>
		<!-- /.navbar-collapse -->
	</div>
	<!-- /.container-fluid -->
</nav>